#include  <stdio.h>

long long res[31] ;

long long fn(int n)
{
	if(res[n] != 0 )
		return res[n];

	res[n] += fn(n-2)*3;
	int i = n - 4;

	while( i > 0  )
	{
		res[n] += fn(i)*2;
		i -= 2;
	}

	res[n] += 2;

	return res[n];
}

int main(int argc, char *argv[])
{
	res[2] = 3;
	res[4] = 11;

	int n;
	while( true )
	{
		scanf("%d",&n);
		if(n == -1)
			break;

		if( n==0 )
		{
			printf("1\n");
			continue;
		}
		if( n%2 == 1 )
		{
			printf("0\n");
			continue;
		}

		if(res[n]!=0)
		{
			printf("%lld\n",res[n]);
			continue;
		}

		printf("%lld\n",fn(n));
	}
}
